<?php
/*
 * Insert function post_views() in anywhere you wanna to display the post_views number.
 * NEED Perform SQL:
 * ALTER TABLE  `wp_posts` ADD  `views_count` INT UNSIGNED NOT NULL
 */
function post_views() {
	global $post;
	echo $post->views_count;
}
function add_post_views($content) {
	if( !is_single() )
		return $content;
	global $wpdb;
	global $post;
	$views_count = $post->views_count + 1;
	$wpdb->query("
		UPDATE $wpdb->posts SET `views_count` =  '$views_count' 
		WHERE ID = $post->ID
	");
	return $content;
}
add_filter('the_content', 'add_post_views');

function most_popular_posts() {
	global $wpdb;
	$post_num = 5;
	$exclude_id = get_the_ID();
	$myposts = $wpdb->get_results("
  		SELECT ID, post_title FROM $wpdb->posts
  		WHERE ID != $exclude_id
  		AND post_status = 'publish'
  		AND post_type = 'post'
  		ORDER BY views_count
  		DESC LIMIT $post_num
	"); 
  	foreach($myposts as $mypost) {
    	echo '<li> <a href="', get_permalink($mypost->ID), '">', $mypost->post_title, '</a></li>';
  	}
}
?>